#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {
    int seed = 500;
    int numPlayer = 2;
    int p, r;
	int x;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    int maxHandCount = 5;

	memset(&G, 23, sizeof(struct gameState));   // clear the game state
	r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

    printf ("TESTING whoseTurn():\n");
	/* go through roughly 5 turns for each player and check to see if it alternates between
	each player every turn */
    for (p = 0; p < 10; p++)
    {
		x = whoseTurn(&G);
		#if (NOISY_TEST == 1)
			printf("Player %d's turn\n", x);
		#endif
		endTurn(&G);
    }

	G.whoseTurn = 1;
	#if (NOISY_TEST == 1)
		printf("Player %d's turn\n", x);
	#endif
	endTurn(&G);
	G.whoseTurn = 1;
	#if (NOISY_TEST == 1)
		printf("Player %d's turn\n", x);
	#endif

    printf("All whoseTurn tests completed!\n");

    return 0;
}
